]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Fix lightbox outside the overview
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 27 May 2013 19:03:46 +0000 (21:03 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 28 May 2013 14:33:47 +0000 (16:33 +0200)
Commit d0310bd745968 blindly replaced global.overlay_group with
Main.layout.overviewGroup, but unlike the former, the latter is
hidden while the overview is not active, which makes it unsuitable
for the message tray's light box. In fact, with the removal of
global.overlay_group, there is no longer a container which may
be used both inside and outside the overview, so we can either
recreate the lightbox each time we show/hide the overview, or
use different lightboxes altogether; this opts for the latter.

https://bugzilla.gnome.org/show_bug.cgi?id=701097

js/ui/messageTray.js

index efba34b082f699c964fc477b0a94ad24f8d20627..c0569247a474932c2cb5aa77db65cfea52c10b0e 100644 (file)
@@ -1658,12 +1658,16 @@ const MessageTray = new Lang.Class({
 
         this.clearableCount = 0;
 
-        this._lightbox = new Lightbox.Lightbox(Main.layoutManager.overviewGroup,
-                                               { inhibitEvents: true,
-                                                 fadeInTime: ANIMATION_TIME,
-                                                 fadeOutTime: ANIMATION_TIME,
-                                                 fadeFactor: 0.2
-                                               });
+        this._lightboxes = [];
+        let lightboxContainers = [global.window_group,
+                                  Main.layoutManager.overviewGroup];
+        for (let i = 0; i < lightboxContainers.length; i++)
+            this._lightboxes.push(new Lightbox.Lightbox(lightboxContainers[i],
+                                                        { inhibitEvents: true,
+                                                          fadeInTime: ANIMATION_TIME,
+                                                          fadeOutTime: ANIMATION_TIME,
+                                                          fadeFactor: 0.2
+                                                        }));
 
         Main.layoutManager.trayBox.add_actor(this.actor);
         Main.layoutManager.trayBox.add_actor(this._notificationWidget);
@@ -2325,7 +2329,8 @@ const MessageTray = new Lang.Class({
                       transition: 'easeOutQuad'
                     });
 
-        this._lightbox.show();
+        for (let i = 0; i < this._lightboxes.length; i++)
+            this._lightboxes[i].show();
 
         return true;
     },
@@ -2380,7 +2385,8 @@ const MessageTray = new Lang.Class({
         // which would happen if GrabHelper ungrabbed for us.
         // This is a no-op in that case.
         this._grabHelper.ungrab({ actor: this.actor });
-        this._lightbox.hide();
+        for (let i = 0; i < this._lightboxes.length; i++)
+            this._lightboxes[i].hide();
     },
 
     _hideDesktopClone: function() {